-
Notifications
You must be signed in to change notification settings - Fork 16
Mime types were not set by default, so enable the mime factory #150
Conversation
Thanks @halkeye . Is this feature testable? Could a test be written for it? |
I don't know. Java is not my strong suit. Is it possible to populate the public directory just for a test? Maybe somewhere in spring boot you could point public to a test directory? |
Okay I did a bunch of searching. I have no idea how to set that up. Is other at-configuration or MVC factory stuff tested? |
Reopening torerun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class MimeMapping implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor question should this be
public class ServletCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory>
since we are using a TomCat server as our default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretend I know nothing. Cause I know nothing.
This solution seems to work but I make no promises. As the expert I defer to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TomcatServletWebServerFactory
is a subclass of ConfigurableServletWebServerFactory
and would probably serve for more specific use cases, but this looks good enough.
CC @martinda @kwhetstone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a net improvement, I added a issue to track testing later.
jenkins.io has tighter restrictions on mime types so i didn't notice it on early testing
Before:
After: